package com.miao.test.support;

import lombok.Data;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/5/29 10:11
 * @Description:
 */
@Data
public class SocketMetrics {
    /**请求/发送时间戳*/
    private long requestStamp;
    /**响应时间戳*/
    private long respStamp;

    public SocketMetrics() {
        this.requestStamp = System.currentTimeMillis();
    }

    public boolean success() {
        return this.respStamp > 0;
    }

    public long getRespTime() {
        return this.respStamp - this.requestStamp;
    }
}
